<template>
  <el-container id="content">
    <el-header class="header" height="70px">
      <div>
        <h1>问卷管理
          <el-button class="logout" type="danger" @click="logout">注销</el-button>
        </h1>
      </div>
    </el-header>
    <el-container>
      <el-aside class="aside" width="200px">
        <SideMenu :data="menus"></SideMenu>
      </el-aside>
      <el-main class="main">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import SideMenu from '../components/SideMenu.vue';

export default {
  components: {
    SideMenu,
  },
  data() {
    return {
      menus: [],
    };
  },
  created() {
    this.menus = this.$router.options.routes;
  },
  methods: {
    logout() {
      localStorage.removeItem('token');
      this.$router.push({ name: 'login' });
    },
  },
};
</script>

<style lang="scss" scoped>
#content {
  height: 721px;
  .header {
    background: #333366;
    h1{
      height: 70px;
      margin: 0;
      line-height: 70px;
      color: #fff;
      .logout{
        width: 70px;
        height: 35px;
      };
    };
  };
  .aside {
    background: #333366;
  };
  .main {
    background: #003366;
    padding: 0 20px;
  };
};

</style>
